package JAVACORE_TRAINING.OOPs.OOPs_EXCERCISES.LEVER02.EX06;

public class Models {
	
	public boolean isEven(MyInteger obj){
    	return (obj.getiValue()%2==0) ? true : false;      	
    }
    
    public boolean isEven(int iValue){
        return (iValue%2==0) ? true : false;    	
    }        
      
    public boolean isOdd(MyInteger obj){
        return (obj.getiValue()%2!=0) ? true : false;    	
    }
    
    public boolean isOdd(int iValue){
        if(iValue%2!=0)
            return true;        
        else
            return false;
    }   
      
    public boolean isPrime(MyInteger obj){
        boolean prime=false;
        for(int i = 2;i<obj.getiValue();i++){
            prime = true;            
                if(obj.getiValue()%i==0){
                    prime=false;
                    break;
                }           
        }
        return prime;
    }
    
    public static boolean isPrime(int iValue){
        boolean prime=false;
        for(int i = 2;i<iValue;i++){
            prime = true;          
                if(iValue%i==0){
                    prime=false;
                    break;
                }           
        }
        return prime;
    }          
}
